package br.com.vm.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import br.com.vm.dao.MapaDAO;
import br.com.vm.model.Mapa;

@Repository
public class MapaDAOImpl extends _GenericDAOImpl<Mapa> implements MapaDAO {

	private static final long serialVersionUID = -844374991470740934L;

	@SuppressWarnings("unchecked")
	@Override
	public List<Mapa> listarPorNome(final String psNome) {

		Query query = super.sessionFactory.getCurrentSession().createQuery(
				"from Mapa where nome = :nome ");
		query.setParameter("nome", psNome.trim().toUpperCase());
		query.setMaxResults(1);
		return query.list();
	}
}
